#!/usr/bin/env bash
#  ▓▓▓▓▓▓▓▓▓▓ 
# ░▓ Author ▓ Abdullah <https://abdullah.today/> 
# ░▓▓▓▓▓▓▓▓▓▓ 
# ░░░░░░░░░░ 

# This script picks a random image from wallpapers directory and locks the
# screen.


walls="$HOME"/pix/wall/collection

random_wallpic="$(find "$walls" -type f -iname '*.png' -print0 | xargs -0 shuf -e -n 1 -z | xargs -0)" 


"$HOME"/.local/bin/i3lock -i "$random_wallpic" \
    --insidecolor=37344500 --ringcolor=ffffffff --line-uses-inside \
    --keyhlcolor=d23c3dff --bshlcolor=d23c3dff --separatorcolor=00000000 \
    --insidevercolor=f0c674ff --insidewrongcolor=bf616aff \
    --ringvercolor=ffffffff --ringwrongcolor=ffffffff \
    --radius=50 --veriftext="" --wrongtext="Try again" --indpos="x+1850:y+1010"

sleep 10 && pgrep i3lock && xset dpms force off
